﻿using System;
using System.ComponentModel.DataAnnotations;

namespace assignment1
{
    class fuction
    {
        public void q1getPrime(int n, int[] primes)
        {
            int pop = 0;
            int i = 2;
            while (i <= n && n > 1)
            {
                if (n % i == 0)
                {
                    n /= i;
                    primes[pop++] = i;
                }
                else i++;
            }
        }
    }
    class ExecuteFunction
    {
        static void Main(string[] args)
        {
            fuction f = new fuction();

            //q1
            int n;
            n = int.Parse(Console.ReadLine());
            int[] arr = new int[n];
            f.q1getPrime(n, arr);
            for (int i = 0; i < arr.Count(); i++)
            {
                if (arr[i] == 0) break;
                Console.WriteLine(arr[i]);
            }
        }
    }
}